package com.bing.bing.servi;

import com.bing.bing.mapper.MyMapper;
import com.bing.bing.pojo.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DuoyuService {

    @Autowired(required = false)
    MyMapper myMapper;

    public void saveTest(String username) {
        Student student = new Student();
        student.setName(username);
        student.setAddr("11");
        student.setAge(11);
        if (username.contains("ai")) {
            Student student1 = new Student();
            student1.setName("kaer");
            student1.setAddr("11");
            student1.setAge(11);
            myMapper.insertSelective(student1);
            int i = 1 / 0;
        }

        myMapper.insertSelective(student);
    }
}
